<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
  
  <head>
    <title>药品添加</title>
    <jsp:include page="header.jsp"></jsp:include>
    <%-- <link rel="stylesheet" href="${pageContext.request.contextPath }/lib/kindeditor/themes/default/default.css" /> --%>
    <script charset="utf-8" src="${pageContext.request.contextPath }/lib/kindeditor/kindeditor-all.js"></script>
	<script charset="utf-8" src="${pageContext.request.contextPath }/lib/kindeditor/lang/zh-CN.js"></script>
    
    <!-- 让IE8/9支持媒体查询，从而兼容栅格 -->
    <!--[if lt IE 9]>
      <script src="https://cdn.staticfile.org/html5shiv/r29/html5.min.js"></script>
      <script src="https://cdn.staticfile.org/respond.js/1.4.2/respond.min.js"></script>
    <![endif]-->
  </head>
  <style>
  	.my-upload {
  		display: block;
  		width: 100px;
  		height: 32px;
  		text-align: center;
  		margin-top: 10px;
  		background-color: red;
  		color:#ffffff;
  		line-height:32px;
  		font-size: 16px;
  	}
  </style>
  <body>
    <div class="x-body">
        <form class="layui-form" id="myForm" action="/admin/stateChange" method="post">
          <div class="layui-form-item">
              <label for="username" class="layui-form-label">
                  <span class="x-red">*</span>订单状态:
              </label>
              <div class="layui-input-inline">
				      <select name="orderState" lay-verify="required" id="orderBy">
				          <option value="">请选择订单状态</option>
			              <option value="1">未支付</option>
			              <option value="2">未审核</option>
			              <option value="3">已审核</option>
			              <option value="4">未发货</option>
			              <option value="5">已发货</option>
			              <option value="6">已完成</option>
			              <option value="7">已退货</option>
			              <option value="8">审核不通过</option>
				      </select>
              </div>
          </div>
          
          <div class="layui-form-item">
              <label for="L_repass" class="layui-form-label">
              	<input type="hidden" name="id" value="${order.id}">
              </label>
             <button  class="layui-btn" lay-filter="add" id="my_add">
                 	确定
              </button>
             
          </div>
      </form>
    </div>
    <script type="text/javascript">
	    $("#orderBy option").each(function() { 
			console.log('${order.orderState}');
			if ($(this).val() == '${order.orderState}') { 
			$(this).attr("selected", "selected"); 
			} 
			}); 
	    $('#my_add').click(function(){
	    	 var form =$('#myForm');
	    	 
	         var index = parent.layer.getFrameIndex(window.name);
	         //关闭当前frame
	         parent.layer.close(index);
	         form.submit();
	         parent.location.reload();
	    });
	</script>
  </body>
</html>